package com.example.stringbufferlogger.dto;

import com.sun.istack.NotNull;

import java.math.BigDecimal;
import java.util.Map;

public class ReplayEntryDTO {

    private String requestId;
    private String method;
    private String url;                // 完整URL（包含查询参数）
    private String path;               // 请求路径
    private String remoteIp;
    private String sessionId;          // 会话ID
    private long duration;
    private Map<String, String> headers;
    private Map<String, Object> requestParams;
    private String requestBody;
    private String responseBody;
    private boolean isUpload;
    private boolean isDownload;
    private String contentType;        // 请求内容类型
    private Integer status;                // 响应状态码
    private Map<String, String> sessionAttributes; // 会话属性


    private String compareStatus;
    private String replayStatus;
    private String timeStamp;
    private String createTime;         // 记录创建时间

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getSessionAttributes() {
        return sessionAttributes.toString();
    }

    public void setSessionAttributes(Map<String, String> sessionAttributes) {
        this.sessionAttributes = sessionAttributes;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getRemoteIp() {
        return remoteIp;
    }

    public void setRemoteIp(String remoteIp) {
        this.remoteIp = remoteIp;
    }

    public BigDecimal getDuration() {
        return BigDecimal.valueOf(duration);
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public Map<String, Object> getRequestParams() {
        return requestParams;
    }

    public void setRequestParams(Map<String, Object> requestParams) {
        this.requestParams = requestParams;
    }

    public String getRequestBody() {
        return requestBody;
    }

    public void setRequestBody(String requestBody) {
        this.requestBody = requestBody;
    }

    public String getResponseBody() {
        return responseBody;
    }

    public void setResponseBody(String responseBody) {
        this.responseBody = responseBody;
    }

    public boolean isUpload() {
        return isUpload;
    }

    public void setUpload(boolean upload) {
        isUpload = upload;
    }

    public boolean isDownload() {
        return isDownload;
    }

    public void setDownload(boolean download) {
        isDownload = download;
    }

    public String getCreateTime() {
        return createTime;
    }

    public String getCompareStatus() {
        return compareStatus;
    }
    public String getReplayStatus() {
        return replayStatus;
    }

    public void setCompareStatus(String compareStatus) {
        this.compareStatus = compareStatus;
    }
    public void setReplayStatus(String replayStatus) {
        this.replayStatus = replayStatus;
    }

    public String getTimeStamp() {
        return timeStamp;
    }
    public void setTimeStamp(String timeStamp) {
        this.timeStamp = timeStamp;
    }

    @Override
    public String toString() {
        return "LogEntryDTO{" +
                "requestId='" + requestId + '\'' +
                ", method='" + method + '\'' +
                ", url='" + url + '\'' +
                ", path='" + path + '\'' +
                ", remoteIp='" + remoteIp + '\'' +
                ", sessionId='" + sessionId + '\'' +
                ", duration=" + duration +
                ", headers=" + headers +
                ", requestParams=" + requestParams +
                ", requestBody='" + requestBody + '\'' +
                ", responseBody='" + responseBody + '\'' +
                ", isUpload=" + isUpload +
                ", isDownload=" + isDownload +
                ", contentType='" + contentType + '\'' +
                ", status=" + status +
                ", sessionAttributes=" + sessionAttributes +
                ", compareStatus='" + compareStatus + '\'' +
                ", replayStatus='" + replayStatus + '\'' +
                ", timeStamp='" + timeStamp + '\'' +
                ", createTime='" + createTime + '\'' +
                '}';
    }



}